home *** CD-ROM | disk | FTP | other *** search
/ Young Minds / Young Minds Interactive CD-ROM.ISO / crystal / cvand.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-01-12  |  857 b   |  37 lines

  1. /* cvand.c
  2.  *    perform acts of vandalism in the "outer" game
  3.  *************************************************************************/
  4.  
  5. #include    <stdio.h>
  6. #include    "cvobj.h"
  7. #include    "cvlocs.h"
  8. #include    "cvocab.h"
  9. #include    "cvmisc.h"
  10. #include    "cvorcs.h"
  11. #include    "cvcode.h"
  12.  
  13. int
  14. mutilate(object) register struct cvobj *object;
  15. {    if (object->prop) {rspeak(25); return 0;} /*already broken*/
  16.     object->prop = 1;
  17.     if (DAM->prop) {rspeak(197); return 0;} /* bust it, but that's all */
  18.     return getrick();
  19. }
  20.  
  21.  
  22. int
  23. getrick()
  24. {    register struct cvloc *dest;
  25.     register int p;
  26.  
  27.     dest = loc;
  28.     rspeak(18); /* He says: */
  29.     pspeak(RICK, p = (RICK->prop++)); /* depends on how annoyed he is */
  30.     DOOR->prop = 1;
  31.     if (p > 1) dest = O_GATE->conn1.where;
  32.     if (p > 2) dest = DOOR->conn1.where;
  33.     if (p > 3) DOOR->prop = 0;
  34.     if (p > 4) destry(KEY);
  35.     return (int)(dest - cvloc);
  36. }
  37.